package com.csg.job;

import com.csg.service.ISmsService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * <p>
 *  短信记录表 数据同步
 * </p>
 *
 * @author GeorgeChan 2019/11/25 17:00
 * @version 1.0
 * @since jdk1.8
 */
public class SyncSmsJob extends QuartzJobBean {
    private static final Logger LOGGER = LoggerFactory.getLogger(SyncSmsJob.class);
    private final ISmsService smsService;

    @Autowired
    public SyncSmsJob(ISmsService smsService) {
        this.smsService = smsService;
    }

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        LOGGER.info("开始同步 rt_sms 数据");
        smsService.syncData();
        LOGGER.info("结束同步 rt_sms 数据");
    }
}
